// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

var candidate_counter = 0;
function addCandidate() {
	candidate_counter++;	
	var name = Builder.node('input',{type:'text',id:'candidate_name_'+candidate_counter,name:'candidate['+candidate_counter+'][name]', style:'width:72%', value:'Name', onclick:'select()'});
	var description = Builder.node('textarea',{id:'candidate_description_'+candidate_counter,name:'candidate['+candidate_counter+'][description]',style:'width:80%', onclick:'select()'},'Description');	
	var remove = Builder.node('a',{onclick:'new Effect.BlindUp(this.parentNode);'},'Remove')	
	var ruler = Builder.node('hr');
	var br = Builder.node('br');		
	var candidate = Builder.node('div',{className:'candidate',id:'candidate['+candidate_counter+']',style:'display:none'},[name,remove,br,description,ruler]);
	$('candidates').appendChild(candidate);	
	new Effect.BlindDown('candidate['+candidate_counter+']');
}

